Added api/AuditLog.js and a test case to frontend.test.js#1864
Open
Added api/AuditLog.js and a test case to frontend.test.js#1864
Conversation
f32e7b2 to
55a53dc
Compare
b5b7c47 to
90afe4d
Compare
01c3cc7 to
311d4a6
Compare
adarshm11
reviewed
Aug 1, 2025
test/api/AuditLog.js
Outdated
| describe('When token and access level is valid - status code 200', () => { | ||
| beforeEach(() => { | ||
| setTokenStatus(true, { accessLevel: MEMBERSHIP_STATE.OFFICER }); | ||
| }); |
Contributor
There was a problem hiding this comment.
do we need a beforeEach inside the test
Collaborator
Author
There was a problem hiding this comment.
I'm afraid it won't work without this block, since the beforeEach in the outer loop overrides all token setup. If this approach slows down the performance badly, we can consider restructuring the test.
Collaborator
Author
There was a problem hiding this comment.
Done! Removed the beforeEach() block and moved all 200-status-code test cases into the same describe block with other test cases.
| details: {email: newUser.email }, | ||
| }); | ||
| } | ||
| }); |
Contributor
There was a problem hiding this comment.
what are these loops for?
Collaborator
Author
There was a problem hiding this comment.
The loops create 63 records. The test checks that, when the query is empty, the route returns at most 50 records from the first page.
95b0963 to
92b35b9
Compare
92b35b9 to
eb66d5f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
frontend-test:

===================================================================================
api-test:
